<?php
class Zend_View_Helper_UserBookStatusView extends Zend_View_Helper_Abstract {
	
    public $view;
    
    public function setView(Zend_View_Interface $view) {
        $this->view = $view;
    }
    
	public function userBookStatusView($book, $user) {
		$userBook = new UserBook();
		$userBook = Book::getUserBook($book, $user);
		$conditions = UserBookCondition::getConditionStrings($userBook->condition);
		$usages = UserBookUsage::getUsageStrings($userBook->usage);
		$html = "<div class='bookItems'><div class='bookItem'><strong>Condition</strong> ";
		$html.=implode(" , ",$conditions)."</div>";
	    $html .= "<div class='bookItem'><strong>Usage</strong> ";
        $html.=implode(" , ",$usages)."</div>";
	    $html .= "<div class='bookItem'><strong>Status</strong> ";
        $html.=$userBook->status."</div>";   
	    $html .= "<div class='bookItem'><strong>Last Modified</strong> ";
        $html.=$userBook->modified."</div>";   
        if ($userBook->note != "")       
        	$html.="<div class='bookItemDesc'>".'"'.$userBook->note.'"'."</div>";
       	$html.="</div>";
		return $html;
	}
}
?>